<button type="button" id="duanxin" data-toggle="modal" data-target="#myModal"></button>
<!-- Modal -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title" id="myModalLabel">短信选择</h4>
      </div>
      <div class="modal-body">
            <form action="{{admin_url('xiaoxi/duanxin')}}" method="post">
                <div class="modal-body">
                    <div class="form">
                    {{ csrf_field() }}
                        <div class="form-group">
                            <div class="input-group input-group-sm">
                            <span class="input-group-addon"><strong>短信模板</strong></span>
                            <select class="form-control" id="selectdx" name="duanxinid">
                              @foreach($list as $val)
                              <option value="{{$val->id}}">{{$val->title}}</option>
                              @endforeach
                              <option>自定义短信</option>
                            </select>
                            </div>
                            <div class="input-group input-group-sm" id="zidingyi" >
                            <span class="input-group-addon"><strong>短信编辑</strong></span>
                            <textarea class="form-control" rows="3" name="duanxin"></textarea>
                            </div>
                        </div>
                        <input type="hidden" id="duanxinid" name="customerid" value="">
                    </div>
                </div>
                <div class="modal-footer">
                    <button type="submit" class="btn btn-primary submit">提交</button>
                    <button type="reset" class="btn btn-warning pull-left">撤销</button>
                </div>
            </form>
      </div>
      
    </div>
  </div>
</div>
<script>
    $("#selectdx").change(function(){
      if($("#selectdx").val()=="自定义短信"){
        $("#zidingyi").show();
      }else{
        $("#zidingyi").hide();
      }
    });
</script>